package com.qingfeng.provide.controller;

import com.qingfeng.core.dao.qingfeng.DeclarationDao;
import com.qingfeng.core.data.ResultData;
import com.qingfeng.core.entity.qingfeng.Declaration;
import com.qingfeng.provide.service.DeclarationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 申明
 * @author:LWY
 * @date: 2017/11/17 14:39
 * @modified:
 */
@RestController
@RequestMapping("/declarat")
public class DeclarationController {


    @Autowired
    DeclarationService declarationService;

    @Autowired
    DeclarationDao declarationDao;

    /**
     * 根据代码获取申明
     *
     * @param d_code 申明代码
     */
    @RequestMapping("/{d_code}")
    public ResultData get(@PathVariable String d_code) {
        Declaration declaration = declarationDao.get(d_code);
        ResultData resultData = new ResultData(ResultData.SUCCESS, "成功", declaration);
        return resultData;
    }


}
